import App from "./App.vue";
import router from "./router";
import { Message } from "element-ui";
import VueLazyload from "vue-lazyload";
import "@/styles/global.scss";
import store from "./store/index.js";
import http from "./axios";

Vue.use(VueLazyload, {
  preLoad: 1.3,
  // error: "@/assets/loading.png",
  // loading: "@/assets/loading.png",
  attempt: 3,
});
Vue.mixin({
  data() {
    return {
      // 获取列表的参数对象
      queryInfo: {
        query: "",
        // 当前的页数
        pagenum: 1,
        // 当前每页显示多少条数据
        pagesize: 10,
      },
    };
  },
  methods: {},
});

Vue.prototype.$http = http;
Vue.config.productionTip = false;

let duration = 1200;
Vue.prototype.$message = function(msg) {
  Message({ message: msg, duration });
};
Vue.prototype.$message.success = function(msg) {
  Message.success({ message: msg, duration });
};
Vue.prototype.$message.error = function(msg) {
  Message.error({ message: msg, duration });
};

new Vue({
  store,
  router,
  render: (h) => h(App),
}).$mount("#app");
